package com.storydo.file.share.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.storydo.file.share.interceptor.AuthInterceptor;

/**   
* @Title: WebConfig.java 
* @Description: TODO
* @author : Storydo
* @date: 2019年7月8日 上午9:59:50 
* @version:V1.0 
* Copyright 悦享互联 2016 All right reserved.
* Modification  History:
* Version       Date          Author          Description
* ----------------------------------------------------------------------------
*  1.0         2019年7月8日        Storydo              TODO
*/
@Primary
@Configuration
public class WebConfig implements WebMvcConfigurer{

	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(getAuthInterceptor()).excludePathPatterns("/css/**", "/js/**");
		//WebMvcConfigurer.super.addInterceptors(registry);
	}
	
	@Bean
	AuthInterceptor getAuthInterceptor() {
		return new AuthInterceptor();
	}
}
